//
// Created by Administrator on 2021/5/19.
//
#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;

class Solution {
public:
    int maximumScore(int a, int b, int c) {
        priority_queue<int> pq;
        pq.push(a);
        pq.push(c);
        pq.push(b);
        int ans = 0;
        int zeroNum = 0;
        while (zeroNum < 2) {
            int x = pq.top();
            --x;
            pq.pop();
            int y = pq.top();
            --y;
            pq.pop();
            ++ans;
            if (x == 0) ++zeroNum;
            if (y == 0) ++zeroNum;
            pq.push(x);
            pq.push(y);
        }
        return ans;
    }

    int maximumScore2(int a, int b, int c) {
        vector<int> v{a, b, c};
        sort(v.begin(), v.end());
        if (v[0] + v[1] <= v[2]) return v[0] + v[1];
        else return (a + b + c) / 2;
    }

};

int main() {
    Solution sol;
    cout << sol.maximumScore2(2, 4, 6) << endl;
    return 0;
}